{-# LANGUAGE OverloadedStrings #-}

import Control.Monad
import Data.List
import qualified Data.Text.IO as T
import System.Environment
import System.IO
import Text.LaTeX
import Util

main :: IO ()
main = do
    args <- getArgs
    pages <- mapM T.readFile args
    printdoc $ doc pages

doc :: Monad m => [Text] -> LaTeXT_ m
doc pages = do
    prelude
    raw "\n"
    document $ mapM_ raw $ intersperse "\n\\mbox{}\\clearpage\n" pages
